home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Business Master (3rd Edition)
/
The Business Master (3rd Edition).iso
/
files
/
utilreen
/
txt2ps
/
post.doc
< prev
next >
Wrap
Text File
|
1992-01-23
|
16KB
|
463 lines
POST 1.2
Introduction: This document describes the MS-DOS utility POST.
POST is a utility that gives MS-DOS based PC's the ability to
print directly to PostScript printers from the DOS prompt. This
information applies to version 1.2 of the POST utility.
Background: The first PostScript based printer was introduced by
Apple Computer. This printer helped establish the desktop
publishing industry because it incorporated PostScript, the
sophisticated Page Description Language (PDL), developed by
Adobe. The printer was designed to work with the Apple Macintosh
using an Apple developed interface called AppleTalk. The printer
designers did however include an RS-232 port so that it could be
connected to other computers such as the IBM-PC and clones.
Software developers soon discovered the power of PostScript and
began to write printer drivers for PC application programs. One
serious drawback however, is the lack of a PostScript driver for
MS-DOS. The POST utility is an attempt to solve this oversight.
Purpose: POST allows users of PC's to print ASCII files directly
to PostScript printers. It is intended to provide PostScript
support for programs that do not have the necessary drivers, and
to allow direct printing of DOS files. POST allows directory
listings to be piped through it directly to a PostScript printer.
POST also allows the user to print files that have been created
by spreadsheet and database programs that can print to ASCII
files.
This new release has been upgraded to allow the user to control
the printing parameters such as top, bottom, left margins and
font style, size and leading. Options for scaling, rotating and
translation are also provided.
Function: POST Reads data from the standard input device,
converts it to PostScript format, then writes the data to the
standard output device.
Command Line Format: (options are explained on next pages)
[d:][path]POST[option 1 value(s) ... option n value(s)]
Upper or lower case is OK except for Font names (this will be
explained later). There are 72 points per inch. The default
page origin is located at the lower left corner with positive X
to the right and positive Y upwards.
The output filename must be different from the input filename.
POST will space to the next column position if it finds a tab
character. Column positions can be defined as preset distances
from the left margin. POST will skip to top of form if it finds
a form feed character. POST will ignore control characters other
than line feed, form feed and tab.
1
POST 1.2
OPTIONS: LETTER: VALUE(S): DEFAULTS:
Left Margin L Left margin in points L 54
Top Print Line T Top print position in points T 720
Bottom Print B Bottom print limit in points B 54
Column Tab C Column tab spacing in points C 56
Typeface Size P Typeface size in points P 12
Leading D Vertical line spacing in points D 12
Typeface Font F Selected font for printing F Courier
Scaling S X and Y scaling multipliers S 1.0 1.0
Page Origin X X and Y page translation points X 0 0
Page Orientation R Page rotation angle in degrees R 0
Details of Options:
L: The left margin is the value assigned in points (72 per inch) to
the leftmost printing position on the page. For instance, if you
want to start printing one inch from the left side of the page you
would include the option - L 72.
T: The top margin is used by the printer every time a new page is
started. Its value is the number of points (72 per inch) from the
bottom of the page to the beginning character position of the first
line on the page. Remember that if you decide to print in the
landscape mode, you will have a smaller number of points to the
first line. POST uses 720 points as the first line default (10
inches times 72 points per inch).
B: The bottom margin is used by the printer to decide when to start a
new page. Every time a new line is started the amount of
line-to-line space defined (see D - leading) is subtracted from the
current position on the page to see if enough room is available.
If not, the current page is printed and printing starts at the top
of a new page. If you are using embedded form feed control, be
sure to set the bottom margin to a value that will keep from
automatically paging before you want to. Also, most PostScript
printers cannot print closer than one fourth to one half inch of
the edge of the paper.
C: The column tab spacing is the increment in points to be added to
the left margin for each tab column across the page. The default
tab column for the first tab is 54 points for the left margin plus
56 points. The next tab column is 56 points more than the first.
2
POST 1.2
P: One advantage of PostScript printers is that they can print
characters in any size desired because they are defined in a manner
that allows them to be scaled very accurately. POST allows any
integer value to be used. The default size is 12 points which is
10 characters per inch. Do not forget that the line-to-line
spacing must be adjusted in conjunction with the typeface size or
overprinting can result. Normally the line-to-line (leading -
option D) spacing should be equal to or greater than the typeface
size.
D: Leading is the line-to-line spacing value. The name is derived
from when type was made from the metal of the same name - lead.
The lead was poured to make rows of letters and the space between
rows was the amount of leading. Be sure to increase the leading
when you increase the type size to avoid overprinting. The leading
value is also used to determine the number of lines per page by
subtracting its value from the calculated line position each time a
new line is started.
F: The default font is Courier. Any other font that is already in the
PostScript printer can be used. Be sure to use upper and lower
case as described by the printer manual. Examples for Courier are:
Courier, Courier-Bold, Courier-Oblique and Courier-BoldOblique. If
you have downloaded a special font, you can select it. The
PostScript printer will ignore requests for incorrectly identified
fonts. Please remember that most of the fonts other than Courier
are proportional and that column data may not line up properly.
Examples other than Courier are not shown because most of the fonts
are copyrighted.
S: Scaling is done by the PostScript printer. It multiplies each X
and Y coordinate by the X and Y scaling factors that you have
provided. The printout can be enlarged or reduced. The X and Y
scaling factors are the only ones that POST allows to be
non-integers. POST sends scaling, then translation and finally
orientation values sequentially to the printer.
X: Page Origin: This will allow you to translate the page origin to
any place on the page. The values specified must be in points.
Remember that if you translate the origin, X and Y positive values
are still up and to the right. If you translate the X coordinate
of the origin to the top of the page, nothing will print because it
will be off the page! Also, any characters that extend beyond the
right edge of the page will also not print. Generally if you
translate the page origin you also need change the orientation of
the page with the Rotate command (option R).
3
POST 1.2
R: Rotation of the coordinate system can be very confusing. The
PostScript printer rotates the page image counter-clockwise by the
number of degrees requested. POST expects the number to be an
integer - i.e. one degree increments. POST sends the rotation
value after it sends the scaling and translation values. See the
example of landscape page orientation for an example and experiment
using variations.
Examples: The following performs a standard directory function, pipes
the output as a standard input to POST and POST converts the
directory listing to PostScript format and sends it to the
PostScript printer:
C>DIR | POST > PRN
The following sends the file infile.ext to POST, POST converts
it to PostScript format and sends it to the file outfile.ext:
C>POST < infile.ext > outfile.ext
The following prints a page in the landscape mode by setting
the top of page at 540 points, translating the origin to the
upper left corner and rotating the page counter-clockwise 270
degrees:
C>POST T 540 X 0 792 R 270 < infile.ext > PRN
The following prints very full pages by setting the left
margin to 24 points, top of page to 756 points and the bottom
of page to 24 points:
C>POST l 24 t 756 b 24 < infile.ext > PRN
Hint: If there are specific functions that you are going to use
often, create batch files with the required options. See your
DOS manual for more information about creating batch files.
4
POST 1.2
Computer Connections:
The purpose of this section is to help you establish the correct
connection and communication method between your computer and PostScript
printer.
POST was developed for people who have a PC (or clone) with a PostScript
printer connected to the parallel port of their PC. That is why the
examples are using "PRN" as the output device. If you have this
configuration, you should have no trouble using the POST utility.
Making the PostScript printer work with a serial connection is slightly
more difficult. The printer and the PC must be set to communicate at
the same speed. 9600 bits-per-second must be used on the LaserWriter.
To set up DOS to communicate correctly, enter the following incantation
at the DOS prompt. Substitute the correct COM port if yours is
different.
MODE COM1:9600,N,8,1,P
This tells DOS to talk to serial device COM1 at 9600 bits-per-second,
with no parity, eight data bits, one stop bit and to continuously retry
to send upon receipt of time out errors from the asynchronous adapter.
You may also want to enter the following:
MODE LPT1:=COM1:
This tells DOS to re-route information intended for the parallel port to
the specified serial port. You may not need this.
Next set your printer to use the serial port at 9600 bits per second
(see your printer manual).
There is one problem that frequently occurs when a PostScript printer is
attached to a PC via the serial ports on both devices. The problem
occurs because the default handshaking (or synchronization) method used
by the devices are different. By default, the Laserwriter and other
PostScript printers use XON/XOFF (software) handshaking. The PC, on the
other hand, uses DSR/DTR (hardware) handshaking. The problem is
exacerbated by the fact that many application programs for the PC
control the serial port directly and implement the software handshake
protocol. This means that your word processor could produce perfect
documents, but the POST utility would not work from the DOS prompt.
In order to solve this problem, a couple of options are available.
The first is to change the default handshaking method of the printer,
and the second is to change the default handshaking method of the PC.
5
POST 1.2
To change the default handshaking method of the printer, you send a
small PostScript program to it. On some printers (such as the NT and
the NTX) you can also change it via the DIP switches. Early versions of
the Laserwriter will not allow you to change the default handshaking
method. If you change the default handshaking method of the printer, a
correctly wired cable is essential. The PostScript program is shown
below. Copy it to the printer using the DOS COPY command.
0000 % Server Password (zeros, not oh's)
statusdict begin 25 sccbatch 4 ne exch 9600 ne or {serverdict begin
exitserver}{pop end stop}ifelse statusdict begin
25 9600 4 setsccbatch
end
Create the file listed above using EDLIN or a wordprocessor that can
create a simple ASCII file. Embed a control D as the last character to
tell the printer that this is the end of the data. (Most MS-DOS based
word processors and text editors support the default method of holding
down the ALT key and entering the decimal value of the required control
character on the keypad. To enter a control D hold down the ALT key and
enter 004 on the keypad. To enter a control character with EDLIN, type
Ctrl-V, then press the Capital D.) This program makes a semi-permanent
change to the printer. That is - it will stay in DSR/DTR protocol until
you change it again. To switch back to XON/XOFF change the two "4"s to
"0"s (zeros, not oh's).
To change the default handshaking method of the PC, you may need to use
a copy of the program XONXOFF.COM included in the ARC file. This program
is a TSR which means it does not go away until you turn off the
computer. XONXOFF.COM works only with COM1. Some PC clones allow you to
specify the handshaking mode of the serial ports. If yours does, you
should have no trouble once you set it for XON/XOFF.
NOTE:
If you have been using POST.COM (the previous version of this utility)
you will need to remove it from the directory when you install POST.EXE.
Otherwise, DOS will execute the old version. DOS always executes the
file with the .COM extension if it exits even if you type in the .EXE
extension.
6
POST 1.2
A D V E R T I S E M E N T
Shareware: This program is distributed as Shareware. If you
find this program useful, send $5.00 to:
F. C. Betts
Veda Incorporated
Suite 200
5200 Springfield Pike
Dayton, OH 45431
Any comments and/or suggestions will be appreciated and a
response will be sent if possible.
7